import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 员工报销-列表
export function getReimbursementList(params, cancelToken) {
  return request({
    url: 'admin/reimbursement/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 员工报销-tab列表
export function getReimbursementTabs(params) {
  return request({
    url: 'admin/reimbursement/tab',
    method: 'get',
    params
  });
}

// 员工报销-列表统计数据
export function getReimbursementStatistics(params) {
  return request({
    url: 'admin/reimbursement/list/statistics',
    method: 'get',
    params
  });
}

// 员工报销-删除
export function deleteReimbursement(id) {
  return request({
    url: `admin/reimbursement/delete/${id}`,
    method: 'delete'
  });
}

// 员工报销-发起
export function storeReimbursement(data) {
  return request({
    url: 'admin/reimbursement/store',
    method: 'post',
    data
  });
}

// 员工报销-借款欠额
export function getUserArrears(id) {
  return request({
    url: `admin/user/arrears/${id}`,
    method: 'get'
  });
}

// 员工报销-编辑
export function editReimbursement(data) {
  return request({
    url: `admin/reimbursement/edit/${data.id}`,
    method: 'put',
    data
  });
}

// 员工报销-详情
export function getReimbursementDetail(id) {
  return request({
    url: `admin/reimbursement/detail/${id}`,
    method: 'get'
  });
}

// 员工报销-编辑说明
export function editReimbursementDesc(data) {
  return request({
    url: 'admin/reimbursement/desc/edit',
    method: 'put',
    data
  });
}
// 员工报销-编辑说明
export function editReimbursementTag(data) {
  return request({
    url: 'admin/reimbursement/tag/edit',
    method: 'put',
    data
  });
}
// 审批流程-提交表单
export function formSubmitReimbursement(data) {
  return request({
    url: 'admin/reimbursement/formSubmit',
    method: 'post',
    data
  });
}

// 流程审批
export function reimbursementProcessAudit(data) {
  return request({
    url: '/admin/reimbursement/process/audit',
    method: 'post',
    data
  });
}

// 流程 - 撤销
export function reimbursementProcessRevocation(data) {
  return request({
    url: '/admin/reimbursement/process/revocation',
    method: 'post',
    data
  });
}

// 流程 - 撤回
export function reimbursementProcessRecall(data) {
  return request({
    url: '/admin/reimbursement/process/recall',
    method: 'post',
    data
  });
}

// 发表评论
export function reimbursementCommentAdd(data) {
  return request({
    url: '/admin/reimbursement/comments/add',
    method: 'post',
    data
  });
}

// 评论列表
export function getReimbursementComments(params) {
  return request({
    url: '/admin/reimbursement/comments/list',
    method: 'get',
    params
  });
}
